#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
char* my_strcat(char* dest, const char* src, int n)//dest目标src源头
{
	//strcat返回值目标空间起始地址
	char* ret = dest;
	assert(dest && src);//(dest!=NULL&&scr!=NULL)
	//找到目标空间的\0
	while (*dest != '\0')
	{
		dest++;
	}
	//拷贝
	while (n != 0 &&  *src != '\0')
	{
		*dest++ = *src++;
		n = n - 1;
	}
	return ret;
}
int main()
{
	char arr1[20] = "hello";
	char arr2[] = " bit";
	printf("%s", my_strcat(arr1, arr2, 3));
}